package com.bye.xiaomi_mall.service.impl;

import java.util.List;

import com.bye.xiaomi_mall.domain.TdOrderDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bye.xiaomi_mall.mapper.TdShoppingCartMapper;
import com.bye.xiaomi_mall.domain.TdShoppingCart;
import com.bye.xiaomi_mall.service.ITdShoppingCartService;

/**
 * 购物车Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-15
 */
@Service
public class TdShoppingCartServiceImpl implements ITdShoppingCartService {
    @Autowired
    private TdShoppingCartMapper tdShoppingCartMapper;

    /**
     * 查询购物车
     *
     * @param id 购物车主键
     * @return 购物车
     */
    @Override
    public TdShoppingCart selectTdShoppingCartById(Long id) {
        return tdShoppingCartMapper.selectTdShoppingCartById(id);
    }

    /**
     * 查询购物车列表
     *
     * @param tdShoppingCart 购物车
     * @return 购物车
     */
    @Override
    public List<TdShoppingCart> selectTdShoppingCartList(TdShoppingCart tdShoppingCart) {
        return tdShoppingCartMapper.selectTdShoppingCartList(tdShoppingCart);
    }

    /**
     * 新增购物车
     *
     * @param tdShoppingCart 购物车
     * @return 结果
     */
    @Override
    public int insertTdShoppingCart(TdShoppingCart tdShoppingCart) {
        return tdShoppingCartMapper.insertTdShoppingCart(tdShoppingCart);
    }

    /**
     * 修改购物车
     *
     * @param tdShoppingCart 购物车
     * @return 结果
     */
    @Override
    public int updateTdShoppingCart(TdShoppingCart tdShoppingCart) {
        return tdShoppingCartMapper.updateTdShoppingCart(tdShoppingCart);
    }

    /**
     * 批量删除购物车
     *
     * @param ids 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteTdShoppingCartByIds(Long[] ids) {
        return tdShoppingCartMapper.deleteTdShoppingCartByIds(ids);
    }

    /**
     * 删除购物车信息
     *
     * @param id 购物车主键
     * @return 结果
     */
    @Override
    public int deleteTdShoppingCartById(Long id) {
        return tdShoppingCartMapper.deleteTdShoppingCartById(id);
    }


}
